/*
 * TabControl.h
 *
 *  Created on: 2011-1-16
 *      Author: Administrator
 */

#ifndef TABCONTROL_H_
#define TABCONTROL_H_

#include <BaseControl.h>

class CTabControl : public CBaseControl
	{
public:
	static CTabControl* NewL(const TRect& aRect,const CCoeControl* aParent);
	static CTabControl* NewLC(const TRect& aRect,const CCoeControl* aParent);
	virtual ~CTabControl();
	
public:
	void Draw(CWindowGc& gc, const TRect& aRect) const;
	void DrawFocusEffect(CWindowGc& gc, const TRect& aRect) const{};
	void DrawLostFocusEffect(CWindowGc& gc, const TRect& aRect) const{};
	TKeyResponse OfferKeyEventL( 
				const TKeyEvent& aKeyEvent, 
				TEventCode aType );
	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
	
public:
	void SetLayout();
	void AddTabCaptionL(const TDesC& aCaption);
	void setIndex(TInt aIndex);
	TInt Index();
	void setFocusImageL(CImage* aImage);
	void setLostFocusImageL(CImage* aImage);
	
protected:
	CTabControl();
	void ConstructL(const TRect& aRect,const CCoeControl* aParent);
	
private:
	CDesC16Array* iTabCaptions;
	RArray<TRect> iRects;
	TInt iIndex;
	CImage* iFocusImage;
	CImage* iLostFocusImage;
	};

#endif /* TABCONTROL_H_ */
